FileTemplateApply
FileTemplateApply[template] applies a template, evaluating all template elements it contains, and then writes the result to a temporary file, whose name is returned.
FileTemplateApply[template,args] applies a template, using args to fill its slots, and then writes the result to a temporary file.
FileTemplateApply[template,output] applies a template, writing the results to the file represented by output.
FileTemplateApply[template,args,output] applies a template, using args to fill its slots, and then writes the result to the file represented by output.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.